﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BCS.Business;

namespace BCS.WinFormAppGui
{
        public partial class GraphicsCardForm : Form
        {
                private BusinessCache cache = BusinessCache.Instance;

                public GraphicsCardForm()
                {
                        InitializeComponent();
                }

                private void GraphicsCardForm_Load(object sender, EventArgs e)
                {
                        BrightnessTrackBar.Value = cache.Camera.Brightness;
                        BrightnessValueLabel.Text = cache.Camera.Brightness.ToString();

                        ContrastTackBar.Value = cache.Camera.Contrast;
                        ContrastValueLabel.Text = cache.Camera.Contrast.ToString();
                }

                private void GraphicsCardForm_FormClosing(object sender, FormClosingEventArgs e)
                {
                        cache.Save();
                }

                private void BrightnessTrackBar_Scroll(object sender, EventArgs e)
                {
                        byte value = (Byte)BrightnessTrackBar.Value;

                        cache.Camera.Brightness = value;
                        BrightnessValueLabel.Text = value.ToString();
                }

                private void ContrastTackBar_Scroll(object sender, EventArgs e)
                {
                        byte value = (Byte)ContrastTackBar.Value;

                        cache.Camera.Contrast = value;
                        ContrastValueLabel.Text = value.ToString();
                }
        }
}